package modelLayer;

public class ClassRoom {

	private int id;
	private String name;
	//private Schedule schedule;
	
	public ClassRoom(String name) {
		
		this.setName(name);
		//this.setSchedule(schedule);
		
	}

	public int getId() {

		return this.id;

	}

	public void setId(int id) {
	
		this.id = id;

	}

	/**public Schedule getSchedule() {

		return this.schedule;

	}

	public void setSchedule(Schedule schedule) {
	
		this.schedule = schedule;

	}*/

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return name;
	}


	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		boolean isEqual = false;
		
		if (obj == null){
			isEqual = false;
		}
			
		if (! (obj instanceof ClassRoom)){
			isEqual = false;
		}
		
		ClassRoom other = (ClassRoom) obj;
		if (this.getName() != null && this.getName().equals(other.getName())) {
			isEqual = true;
		} 
		return isEqual;
	}
	
	
	
}
